<?php

if (!defined("BASEPATH"))
    exit("No direct script access allowed");

class Cf_model extends CI_Model{
    
    public function __construct() {
        parent::__construct();
    }
    
    public function GetGt(){
        $q = $this->db->where("cf_name", "GT")
        ->get("web_config");
        return $q;
    }
    
    public function EditGt($content){
        if(isset($content) && $content != NULL){
            $this->db->where("cf_name","GT");
        }
        $q = $this->db->update("web_config", array("cf_content"=>$content));
        if($q){
            return TRUE;
        }else{
            return FALSE;
        }
    }
    //lien he
    public function GetLh(){
        $q = $this->db->where("cf_name", "LH")
        ->get("web_config");
        return $q;
    }
    
    public function EditLh($content){
        if(isset($content) && $content != NULL){
            $this->db->where("cf_name","LH");
        }
        $q = $this->db->update("web_config", array("cf_content"=>$content));
        if($q){
            return TRUE;
        }else{
            return FALSE;
        }
    }
    //huong dan thanh toan
    public function GetHdtt(){
        $q = $this->db->where("cf_name", "hdtt")
        ->get("web_config");
        return $q;
    }
    
    public function EditHdtt($content){
        if(isset($content) && $content != NULL){
            $this->db->where("cf_name","hdtt");
        }
        $q = $this->db->update("web_config", array("cf_content"=>$content));
        if($q){
            return TRUE;
        }else{
            return FALSE;
        }
    }
    //chi phi van chuyen
    public function GetCpvc(){
        $q = $this->db->where("cf_name", "cpvc")
        ->get("web_config");
        return $q;
    }
    
    public function EditCpvc($content){
        if(isset($content) && $content != NULL){
            $this->db->where("cf_name","cpvc");
        }
        $q = $this->db->update("web_config", array("cf_content"=>$content));
        if($q){
            return TRUE;
        }else{
            return FALSE;
        }
    }
}
?>
